﻿using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace JTLeigh.Commerce.Spencer.Features.ProductFeedback.Business.UnitTests
{

	/// <summary>
	/// Unit tests for the <see cref="BooleanCounter"/> class.
	/// </summary>
	[TestClass]
	public class BooleanCounterFixture
	{

		#region Methods

		/// <summary>
		/// Tests all methods and properties of the counter.
		/// </summary>
		[TestMethod]
		public void TestBooleanCounterOperation()
		{
			BooleanCounter counter;

			counter = new BooleanCounter();
			Assert.AreEqual(0, counter.Count);
			Assert.AreEqual(0, counter.PositiveCount);

			counter.AddValue(true);
			counter.AddValue(true);
			counter.AddValue(true);
			counter.AddValue(false);
			counter.AddValue(false);
			Assert.AreEqual(5, counter.Count);
			Assert.AreEqual(3, counter.PositiveCount);

			counter.Reset();
			Assert.AreEqual(0, counter.Count);
			Assert.AreEqual(0, counter.PositiveCount);
		}

		#endregion // Methods

	}

}
